﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Young3.FMSearch.Core.Entities.InGame;

namespace Young3.FMSearch.Core.Entities.InGame
{
    public static partial class PositionalRatings
    {
        private static Func<PlayerSkills, decimal> __midRatings = null;
        public static Func<PlayerSkills, decimal> MidfielderRatings
        {
            get
            {
                if (__midRatings == null)
                {
                    __midRatings = (p) =>
                        (Convert.ToDecimal(
                        p.Crossing*10+
                        p.Dribbling*40+
                        p.Finishing*20+
                        p.FirstTouch*30+
                        p.Heading*10+
                        p.Marking*10+
                        p.Passing*80+
                        p.Tackling*60+
                        p.Technique*60+
                        
                        p.Aggression*10+
                        p.Anticipation*40+
                        p.Bravery*20+
                        p.Composure*40+
                        p.Concentration*10+
                        p.Creativity*60+
                        p.Decisions*40+
                        p.Influence*10+
                        p.OffTheBall*40+
                        p.Positioning*60+
                        p.Teamwork*40+
                        p.Workrate*60+
                        
                        p.Acceleration*70+
                        p.Agility*30+
                        p.Balance*20+
                        p.Jumping*20+
                        p.Pace*70+
                        p.Stamina*60+
                        p.Strength*40
                        )
                        / Convert.ToDecimal((10+40+20+30+10+10+80+60+60+10+40+20+40+10+60+40+10+40+60+40+60
                        +70+30+20+20+70+60+40) * 100));
                }
                return __midRatings;
            }
        }
    }
}
